package com.mask.im.common.enums;


import com.mask.im.common.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @author jian
 */

@Getter
@AllArgsConstructor
public enum RegisterStrategyEnum {

	EMAIL_REGISTER("emailRegister","emailRegisterImpl"),
	PHONE_REGISTER("phoneRegister","phoneRegisterImpl");
	private final String type;
	private final String strategy;
	public static String getStrategy(String type){
		for (RegisterStrategyEnum value : RegisterStrategyEnum.values()) {
			if (value.type.equals(type)){
				return value.strategy;
			}
		}
		throw new BusinessException("错误请求");
	}
}
